import { Component } from '@angular/core';
import { Router, ActivatedRoute, NavigationEnd } from '@angular/router';
import { filter } from 'rxjs/operators';
import { get } from 'lodash';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.less']
})
export class AppComponent {
  showButtonNav = true;
  constructor(private router: Router, private route: ActivatedRoute) {
    this.router.events.pipe(filter(evt => evt instanceof NavigationEnd)).subscribe((_: NavigationEnd) => {
      this.showButtonNav = get(this.route, 'snapshot.firstChild.data.showBottomNav', true);
    })
  }
}
